<template>
	<view class="run-container">
		<u-navbar bgColor="#000000" autoBack height="90" placeholder fixed>
			<view class="u-nav-slot" slot="center">
				<!-- 正文内容 -->
				<text>跑步</text>
			</view>
		</u-navbar>
		<!-- 头部 -->
		<view class="run-hd">
			<view class="hd-left">
				<text>累计跑步距离</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
			<view class="hd-right">
				<u-icon :name="require('@/static/imgs/sun.png')"></u-icon>
				<text style="margin-left: 10rpx;">13℃ 优</text>
			</view>
		</view>
		<view class="run-data">
			<text style="font-size: 60rpx;">0.00</text>
			<text style="font-size: 36rpx;color: #676767;margin-left: 10rpx;">公里</text>
		</view>
		<!-- 跑步机 -->
		<view class="treadmill">
			<view class="treadmill-tabs">
				<u-tabs :list="list1" lineColor="#000000" activeStyle="color:#ffffff" :current="current"></u-tabs>
			</view>
			<view class="treadmill-btn">
				<view @click="toRun(item)" class="btn-item" v-for="(item,index) in btnList" :key="index"
					:style="{fontSize:item.font+'rpx',width:item.width,height:item.height,background:item.color,lineHeight:item.height}">
					{{item.name}}
				</view>
			</view>
		</view>
		<!-- 地图 -->
		<view class="run-map">
			<view class="map-title">附近适合开跑的路线</view>
			<view class="map-content">
				<image src="../../static/imgs/map.png" mode=""></image>
				<view class="map-name">
					<view>加州花园小区跑道</view>
					<view>全长2.5公里</view>
				</view>
				<view class="look">去看看</view>
			</view>
		</view>
		<!-- 遮罩层 -->
		<u-overlay :show="show" @click="show = false">
			<view class="warp" @tap.stop>
				<text>{{timeOut}}</text>
			</view>
		</u-overlay>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				timeOut: 4,
				show: false,
				list1: [{
						name: '户外跑'
					},
					{
						name: "跑步"
					}
				],
				current: 1,
				btnList: [{
						color: "#8560E4",
						width: "110rpx",
						height: "110rpx",
						name: "目标",
						font: 26
					},
					{
						color: "#59A85F",
						width: "207rpx",
						height: "207rpx",
						name: "开始",
						font: 48,
						path: "/pages/index/startRun"
					},
					{
						color: "#E98D44",
						width: "110rpx",
						height: "110rpx",
						name: "音乐",
						font: 26
					}
				]
			};
		},
		methods: {
			count() {},
			toRun(item) {
				if (item.name === '开始') {
					uni.navigateTo({
						url: "/pages/index/startRun"
					})
				}
			}
		},

	}
</script>

<style lang="scss" scoped>
	.warp {
		height: 100%;
		background-color: #000000;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 600rpx;
	}

	/deep/.u-tabs__wrapper__nav {
		justify-content: center;
	}

	.run-container {
		height: 100%;
		background-color: #000000;
		padding: 0 60rpx;
		overflow-y: auto;

		.u-nav-slot {
			font-size: 46rpx;
			font-weight: bold;
		}

		.run-hd {
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #676767;

			.hd-left,
			.hd-right {
				display: flex;
				align-items: center;
			}
		}

		.run-data {
			margin-top: 40rpx;
		}

		.treadmill {
			.treadmill-tabs {
				margin: 100rpx 0;
			}

			.treadmill-btn {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.btn-item {
					border-radius: 50%;
					text-align: center;
				}
			}
		}

		.run-map {
			margin: 200rpx 0 40rpx 0;
			border-radius: 10rpx;
			background: #262626;
			padding: 30rpx 20rpx;

			.map-content {
				display: flex;
				justify-content: space-between;
				margin-top: 40rpx;

				image {
					width: 222rpx;
					height: 222rpx;
				}

				.map-name {
					margin-top: 40rpx;
				}

				.look {
					margin-top: 180rpx;
					width: 110rpx;

					border-radius: 15rpx;
					border: 1px solid #000000;
					background: #F6FF00;
					height: 42rpx;
					line-height: 42rpx;
					text-align: center;
					color: #000000;
					font-size: 18rpx;
				}
			}
		}
	}
</style>
